package com.ptszyxx.popose.module.main.game.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;
import com.ptszyxx.popose.R;
import com.ptszyxx.popose.databinding.ItemGameCommentBinding;
import com.ysg.http.data.entity.game.GameCommentEntity;

public class GameCommentAdapter extends BaseQuickAdapter<GameCommentEntity, BaseDataBindingHolder<ItemGameCommentBinding>> {

    public GameCommentAdapter() {
        super(R.layout.item_game_comment);
    }

    @Override
    protected void convert(BaseDataBindingHolder<ItemGameCommentBinding> holder, GameCommentEntity item) {
        ItemGameCommentBinding binding = holder.getDataBinding();
        if (binding != null) {
            binding.setEntity(item);
            binding.executePendingBindings();

            try {
                binding.ratingBar.setRating(Float.valueOf(item.getScore()));
            }catch (Exception e){
            }
        }
    }






}
